# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=kalker
pkgver=2.2.1
pkgrel=0
pkgdesc="Calculator that supports user-defined variables, functions, differentiation, and integration"
url="https://kalker.xyz"
# s390x: nix, loongarch64: libc
arch="all !s390x !loongarch64"
license="MIT"
makedepends="
	cargo
	cargo-auditable
	gmp-dev
	m4
	mpc1-dev
	mpfr-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/PaddiM8/kalker/archive/refs/tags/v$pkgver.tar.gz
	system-libs.patch
	"
options="net" # fetching cargo crates

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET"
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/kalker "$pkgdir"/usr/bin/kalker
}

sha512sums="
fd5eba6a4d2d2ea04cac6eea0921bac430f53279d445d6078cee6737b2595d30eb1a56d106d24f5a08d5a11fb77c896432526846ad6ec9b017046b6569c72ee0  kalker-2.2.1.tar.gz
3896edc54f59ada422cc049dba184707253a46c79aad60b010d0db4fa0af6ea59b0e577f34b1105051e7b370ea020a03266382d8bb8148ca3bb2bfdd3cf999bd  system-libs.patch
"
